<?php
/**
 * @Author: Guo_ShiXin
 * @Date: 2017-6-29
 * @Time: 13:23
 * @File: Test.php
 */
class Users extends MY_Controller
{
    /**
     * 接收GET请求
     *
     */
    public function index_post()
    {
        $a = $this->_check_login();
        if($a)
        {
            echo 'ok';
        }else
        {
            echo 'You dont login';
        }
//        print_r($_SERVER['REQUEST_URI']);
//        echo '______';
//        print_r($_SERVER['PATH_INFO']);
    }

    public function index_get()
    {
        $arr = [
            'code'           => 200,
            'request_method' => 'GET',
            'data'           => [
                'name'  => 'Guo',
                'age'   => 24,
                'work'  => 'PHP'
            ],
            'response_time'  => microtime(1)
        ];
        $return = json_encode($arr);
        print_r($return);
    }

    public function index_put()
    {
        print_r($_SERVER['REQUEST_METHOD']);
        print_r($_SERVER['REQUEST_URI']);
    }

    public function index_delete()
    {
        print_r($_SERVER['HTTP_HOST']);
    }
}